home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / utils / sun4.md / dumpEvents.c < prev    next >
C/C++ Source or Header  |  1990-10-12  |  3KB  |  122 lines

  1. /* 
  2.  * dumpEvents.c --
  3.  *
  4.  * Routines to register events (characters) for debugging dump program.
  5.  *
  6.  * Copyright 1985 Regents of the University of California
  7.  * All rights reserved.
  8.  */
  9.  
  10. #ifndef lint
  11. static char rcsid[] = "$Header: /sprite/src/kernel/utils/sun3.md/RCS/dumpEvents.c,v 9.2 90/10/11 22:02:32 kupfer Exp $ SPRITE (Berkeley)";
  12. #endif not lint
  13.  
  14.  
  15. #include <sprite.h>
  16. #include <dev.h>
  17. #include <dumpInt.h>
  18. #include <stdio.h>
  19.  
  20. static void ConsoleReset _ARGS_((ClientData data));
  21.  
  22. /*
  23.  * Table of routines and their arguments to be called on dump events.
  24.  */
  25. static EventTableType sunEventTable[] = {
  26.     {'k', ConsoleReset, (ClientData) TRUE,"Reset console to keyboard mode"},
  27.     {'l', ConsoleReset, (ClientData) FALSE,
  28.                     "Reset console to raw mode (for X)"},
  29.     /* This MUST be the last entry */
  30.     {'\000', LAST_EVENT, NULL_ARG, (char *) 0 }
  31. };
  32.  
  33.  
  34. /*
  35.  *----------------------------------------------------------------------
  36.  *
  37.  * ConsoleReset --
  38.  *
  39.  *    Wrapper around Dev_ConsoleReset to avoid casts and 
  40.  *    compiler warning messages.
  41.  *
  42.  * Results:
  43.  *    None.
  44.  *
  45.  * Side effects:
  46.  *    (see Dev_ConsoleReset)
  47.  *
  48.  *----------------------------------------------------------------------
  49.  */
  50.  
  51. static void
  52. ConsoleReset(data)
  53.     ClientData data;
  54. {
  55.     Dev_ConsoleReset((int) data);
  56. }
  57.  
  58. /*
  59.  *----------------------------------------------------------------------
  60.  *
  61.  * Dump_Register_Events --
  62.  *
  63.  *    Establish default procedural attachments for keyboard invocation
  64.  *    of Dump routines.
  65.  *
  66.  * Results:
  67.  *    None.
  68.  *
  69.  * Side effects:
  70.  *    None. 
  71.  *
  72.  *----------------------------------------------------------------------
  73.  */
  74.  
  75. void
  76. Dump_Register_Events(eventTable)
  77.     EventTableType    *eventTable;
  78. {
  79.     EventTableType    *entry;
  80.  
  81.     for (entry = eventTable; entry->routine != LAST_EVENT; entry++) {
  82.     if (entry->routine == RESERVED_EVENT) {
  83.         continue;
  84.     }
  85.     Dev_RegisterConsoleCmd(entry->key, entry->routine, entry->argument);
  86.     }
  87.  
  88.     for (entry = sunEventTable; entry->routine != LAST_EVENT; entry++) {
  89.     if (entry->routine == RESERVED_EVENT) {
  90.         continue;
  91.     }
  92.     Dev_RegisterConsoleCmd(entry->key, entry->routine, entry->argument);
  93.     }
  94.  
  95. }
  96.  
  97.  
  98. /*
  99.  *----------------------------------------------------------------------
  100.  *
  101.  * Dump_Show_Local_Menu --
  102.  *
  103.  *    Dump out a list of the local to the Sun L1-key magic commands.
  104.  *
  105.  * Results:
  106.  *    None.
  107.  *
  108.  * Side effects:
  109.  *    None.
  110.  *
  111.  *----------------------------------------------------------------------
  112.  */
  113. void
  114. Dump_Show_Local_Menu()
  115. {
  116.     EventTableType    *entry;
  117.  
  118.     for (entry = sunEventTable; entry->routine != LAST_EVENT; entry++) {
  119.     printf("%c - %s\n",entry->key, entry->description);
  120.     }
  121. }
  122.